package 刷题10月.leecodehot100;
// 本题为考试多行输入输出规范示例，无需提交，不计分。
import java.util.Scanner;

public class Main1 {
    public static  boolean isTrue(int code){
        int arr[]=new int[]{301,302,303,304,307,400,401,403,404,405,500,503};
        if(code==200){
            return false;
        }
        else if(exist(code,arr)==true){
            return true;
        }
           return false;
    }
    public static boolean exist(int code,int arr[]){
        for (int i = 0; i <arr.length ; i++) {
            if(arr[i]==code){
                return true;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x=0;
        String arr[]=new String[n];
        for(int i = 0; i < n; i++){
                x = sc.nextInt();
                if(isTrue(x)==true){
                    arr[i]="Yes";
                }
                else {
                    arr[i]="No";
                    //System.out.println("No");
                }
        }
        for(String a:arr){
            System.out.println(a);
        }
    }
}